package sctu.edu.java.year2016.team02.zhoujie.day20160523.chapter5_3;

/**
 * Created by ACER on 2016/5/24.
 */
/*编写java程序，创建二维数组arr【】【】，将二维数组中所有元素的和输出*/
public class SumNum {
    public static void main(String[] args) {
        int[][] arr =new int[3][4];
        int sum = 0;
        System.out.println("输出一堆数组：");
        for (int i = 0; i <arr.length ; i++) {
           for(int j=0;j<arr[0].length;j++) {arr[i][j]=i+j;
            System.out.println(arr[i][j]);
                sum = sum+ arr[i][j];}
        }
        System.out.println("数组之和为：");
        System.out.println(sum);


    }
}
